#!/bin/bash

action=$1

echo -e "\e[32maction:$action \e[0m"

if [ "$action" != "install" ];then
    echo -e "\e[32mnot support action:$action \e[0m"
    exit 1
fi


folder="build"
if [ -d "$folder" ]; then
    rm -rf "$folder"
fi

install_ONVIF(){
    echo -e "\e[32minstall onvifTool start\e[0m"
    #安装
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./thirdlibex/onvifTool .
    cd build
    make && make install
    echo -e "\e[32minstall onvifTool end\e[0m"

    cd ..
    if [ -d "$folder" ]; then
        rm -rf "$folder"
    fi

}



install_ONVIF
exit 0

